using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMoveState : PlayerGroundedState
{
    public PlayerMoveState(PlayerStateMachine _stateMachine, Player _player, string _animBoolName) : base(_stateMachine, _player, _animBoolName)
    {
    }

    public override void Enter()
    {
        base.Enter();

        AudioManager.instance.PlaySFX(3,null);
    }

    public override void Exit()
    {
        base.Exit();

        AudioManager.instance.StopSFX(3);
    }

    public override void Update()
    {
        base.Update();

        player.SetVelocity(x_Input * player.moveSpeed, rb.velocity.y);

        if (x_Input == 0 || player.IsWallChecked())
            stateMachine.ChangeState(player.IdleState);
    }
}
